1. Field of the Invention
The present invention relates to a drawing device and drawing method, as well as a distribution medium, and more specifically, it concerns a drawing device and drawing method, and a distribution medium, that will make it possible to display images of high picture quality on, for example, three-dimensional graphic computers, which are image devices that employ a computer, or on special effects devices (effectors), video game machines, or the like.
2. Description of the Prior Art
The higher degree of integration and higher speeds achieved in processors and memories have made possible what was previously difficult, namely the generation of three-dimensional images in real time, making it possible to display three-dimensional images with a sense of presence on video game machines, for example. If a three-dimensional image is to be displayed, in many cases the three-dimensional image is broken up into multiple polygons (unit graphic forms), and the three-dimensional image as a whole is drawn by drawing each of these polygons. Thus it can be said that a three-dimensional image that is drawn in this way is defined as a combination of polygons.
For example, the display of a three-dimensional image is accomplished by performing coordinate transformations on the data of the polygons that comprise it, performing geometrical processing such as clipping and lighting, and performing perspective and projective transformations on the data obtained from such processing, thus taking data in three-dimensional space and turning it into pixel data in a two-dimensional plane, then drawing it. But in such drawing, the position of a polygon, which until then was expressed by floating point or fixed point, is converted to integers corresponding to the pixels in fixed positions on the screen. This results in aliasing and xe2x80x9cjaggyxe2x80x9d staircase-like edges, creating the problem that the picture quality is inferior to that of an image taken with a video camera.
In addition, there is a further problem that aliasing appears as flickering of the image, which disconcerts the viewer.
Here, aliasing is not limited to images; when a signal is sampled at a finite number of points, it is the sampling error that occurs due to the fact that the number of sampling points is too small.
One method for reducing the degradation of picture quality caused by aliasing is to virtually divide each pixel into smaller units called subpixels, and after ray tracing or some other calculation is done in these subpixel units, the results of the calculation are averaged to the nearest pixel unit, but ray tracing computation takes considerable time, and despite the speedup in processors, memory, and other hardware, at the present time it is impossible to do such ray tracing computation in real time for moving images. That is, a moving image generally consists of about 20-30 frames per second, but at present it is impossible with reasonably priced hardware to perform ray tracing computations 20-30 times a second in subpixel units.
Another method is to perform antialiasing (reducing the degradation in picture quality that is caused by aliasing) by generating a high-resolution image and filtering it to reduce the number of pixels, but displaying moving images by this method requires a fast, high-capacity frame buffer or Z buffer to store the high-resolution images, which makes the equipment big and expensive.
Another method to carry out antialiasing is a technique known as xcex1 blending, in which, if for example a certain graphic form is to be displayed, the proportion of the pixel that the graphic form occupies is determined, and it graphic form and background are xcex1-blended based on this proportion. This method is used for the edges of graphic forms, but it is not effective for the flickering of textures put onto graphic forms or for the aliasing that occurs where three-dimensional shapes cross each other (intersection lines) (for example, if one sphere sinks into another, the part where the two spheres intersect each other).
It is an object of the present invention to reduce the degradation in picture quality caused by aliasing, while avoiding as much as possible any increase in the cost or size of the equipment.
This and other objects of the present invention are obtained by a drawing device comprising a shift amount setting means for setting multiple shift amounts for shifting, with a precision finer than one pixel, a drawing position when pixel data is to be drawn in a pixel data memory means, and, a drawing means in the pixel data memory means, for overwriting the image by drawing the pixel data in each position corresponding to the multiple shift amounts set by the shift amount setting means.
According to the present invention, a drawing method is proposed, which comprises a shift amount setting step of setting multiple shift amounts for shifting, with a precision finer than one pixel, the drawing position when the pixel data is to be drawn in the pixel data memory means of the drawing device, and a drawing step of overwriting the image by drawing the pixel data to each position of the pixel data memory means corresponding to the multiple shift amounts.
According to the present invention a distribution medium is proposed that provides a computer program that has a shift amount setting step that sets multiple shift amounts for shifting, with a precision finer than one pixel, the drawing position when the pixel data is to be drawn to memory, and a drawing step that overwrites the image by drawing the pixel data to each position of the memory corresponding to the multiple shift amounts.
In the drawing device of the present invention, the shift amount setting means sets multiple shift amounts for shifting, with a precision finer than one pixel, the drawing position when the pixel data is to be drawn in the pixel data memory means, and the drawing means, in the pixel data memory means, overwrites the image by drawing the pixel data in each position corresponding to the multiple shift amounts set by the shift amount setting means.
In the drawing method of the present invention, multiple shift amounts are set for shifting, with a precision finer than one pixel, the drawing position when the pixel data is to be drawn in the pixel data memory means, and the image is overwritten by drawing the pixel data to each position of the pixel data memory means corresponding to the multiple shift amounts.
In the distribution medium of the present invention, a computer program is provided for causing the computer to set multiple shift amounts for shifting, with a precision finer than one pixel, the drawing position when the pixel data is to be drawn to memory, and to carry out the processing to overwrite the image by drawing the pixel data to each position of the memory corresponding to the multiple shift amounts.
In the embodiment, the drawing device of the present invention includes a pixel data memory means that stores pixel data to be output to a two-dimensional output device that outputs the image (for example a frame buffer), a shift amount setting means that sets multiple shift amounts for shifting, with a precision finer than one pixel, the drawing position when the pixel data is to be drawn in the pixel data memory means, and a drawing means in the pixel data memory means that overwrites the image by drawing the pixel data in each position corresponding to the multiple shift amounts set by the shift amount setting means.
In a further embodiment, the drawing device further includes a count determination means that determines the number of overwriting times the drawing means shall overwrite the image.
The drawing means of the drawing device of this invention may further include an estimation means that estimates the drawing time needed for drawing one screenful of the pixel data to the pixel data memory means, and the count determination means determines the number of overwriting times based on the drawing time estimated by the estimation means.
According to yet another embodiment, the drawing device, if the image is a moving image, further comprises a correction means that corrects the shift amounts based on the movement of the moving image.
In the drawing device of the present invention if the image is a three-dimensional image defined by a combination of unit graphic forms, a sorting means is provided that sorts the unit graphic forms into the order of their depth direction, and the drawing means draws the unit graphic forms in order, beginning with those near the viewpoint.
The drawing device may further comprise an operation means that is operated when a prescribed input is given, an arithmetic operation means that reads in data recorded in a storage medium and performs the prescribed arithmetic operations using this data, based on input from the operation means, such as main CPU, and a pixel data generation means for example GPU, that determines the pixel data based on the results of the arithmetic operation by the arithmetic operation means.
In the drawing device of the present invention, if the image is a three-dimensional image defined by a combination of unit graphic forms, a conversion means is provided that, in accordance with the viewpoint, converts the unit graphic forms that constitute the three-dimensional image to ones in the coordinate system of the two-dimensional output device, for example, CPU, a sorting means that sorts the unit graphic forms converted by the conversion means into the order of their depth direction and a depth memory means (for example Z buffer) that records the values that represent the position of the unit graphic forms in the depth direction, and using the depth memory means, the drawing means draws the unit graphic forms in order, beginning with those near the viewpoint.
In the drawing device of the present invention, if the image is a three-dimensional image defined by a combination of unit graphic forms, it further, comprises an operation means that is operated when a prescribed input is given, an arithmetic operation means that reads in data recorded in a storage medium and performs the prescribed arithmetic operations using this data, based on input from the operation means, for example, main CPU, a conversion means that converts the unit graphic forms obtained as a result of calculation by the arithmetic operation means to ones in the coordinate system of the two-dimensional output device, a sorting means that sorts the unit graphic forms converted by the conversion means into the order of their depth direction, and a depth memory means that records the values that represent the position of the unit graphic forms in the depth direction (for example Z buffer), and using the depth memory means, the drawing means draws the unit graphic forms in order, beginning with those near the viewpoint.